package com.example.ch8;

import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class AdvisorTagHandler extends SimpleTagSupport {
	
	private String user;
	
	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	@Override
	public void doTag() throws JspException, IOException {
		getJspContext().getOut().write(getAdvice());
	}
	
	protected String getAdvice() {
		return "hello " + user + ", this is your advice!";
	}
	
}
